﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Vip_List.aspx.cs" Inherits="ncp.Web.cms.Vip_List" %>
<%@ OutputCache Location="none" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../../themes/icon.css" />
	<script type="text/javascript" src="../../js/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="../../js/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../../js/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="../../../js/common.js"></script>
</head>
<body style="margin:0; padding:0px;">
    <form id="form1" runat="server">
        <div id="divright">    
        </div>
	</form>
</body>
</html>
<script type="text/javascript">
    $(function() {
        initDatagrid();
        LoadVipInfo();
    });


    //初始化表格
    function initDatagrid() {
        $('#divright').datagrid({
            width: 'auto',
            height: 300,
            nowrap: true,
            striped: true,
            singleSelect: true,
            sortName: 'Vip_Id',
            sortOrder: 'asc',
            remoteSort: false,
            idField: 'Vip_Id',
            columns: [[
					{ field: 'Client_Account', title: '客户帐号', sortable: 'true', width: 80 },
					{ field: 'Client_Name', title: '客户名称', sortable: 'true', width: 100 },
					{ field: 'User_Email', title: '邮箱', sortable: 'true', width: 100, align: 'center' },
					{ field: 'User_CellPhone', title: '手机', sortable: 'true', width: 100, align: 'center' },
					{ field: 'User_Contact', title: '联系人', sortable: 'true', width: 80, align: 'center' },
					{ field: 'Vip_StartDate', title: '开始时间', sortable: 'true', width: 120, align: 'center',
					    formatter: function(value, rec) {
					        return value.replace(" 00:00:00", "");
					    }
					},
					{ field: 'Vip_EndDate', title: '到期时间', sortable: 'true', width: 120, align: 'center',
					    formatter: function(value, rec) {
					        return value.replace(" 00:00:00", "");
					    }
					},
					{ field: 'isVip', title: '是否到期', sortable: 'true', width: 60, align: 'center',
					    styler: function(value, row, index) {
					        if (value < 0) {
					            return 'background-color:#33CC00;color:#fff;font-weight:bold;';
					        }
					    },
					    formatter: function(value, rec) {
					        if (value / 1 > 0) {
					            return '是';
					        }
					        else {
					            return '否';
					        }
					    }
					}
				]]
        });
    }


    //装载客户信息视图
    function LoadVipInfo() {
        var data = eval(ncp.Web.cms.Vip_List.BindTable(QueryString("client_id")).value);
        $('#divright').datagrid('loadData', data);
    }

    //关闭客户信息对话框
    function onClose() {
        $('#divBox').window("close");
    }
</script>
